import { createApp } from 'vue'
import App from './App.vue'


import router from "./router"
// import store from "./store"

import axios  from 'axios'

import {$get, $postx, $postj, $postf } from './ajax/index.js'

console.log("main.js")
  const vm= createApp(App)
   vm.use(router)
  import { createStore } from 'vuex'
 const store =createStore({
	 state(){
	 return{
		 user:{
				 name:"",
				 role:'',
				 rloename:'',
				 token:'',
				 pic:''
		 }
	 }
	 
	 }
 })
 
 vm.use(store)
       //  创建 全局 属性 变量
 vm.config.globalProperties.$store=store;
 
 
 vm.config.globalProperties.$get= $get; 
 vm.config.globalProperties.$postf= $postf; 
 vm.config.globalProperties.$postj= $postj; 
 vm.config.globalProperties.$postx= $postx;
 
 vm.config.globalProperties.$showErr= function( msg ) {
 	store.state.erropen = true;
 	store.state.errmsg=msg
 }




      //  创建全局 变量
vm.config.globalProperties.$axios = axios;
vm.config.globalProperties.$ip ="http://127.0.0.1:9000";

vm.use(store)
vm.mount("#app")
   
// createApp(App).mount('#app')
